dac24 2.2.0
Loading...
Searching...
No Matches
dac24.h File Reference

This file contains API for DAC 24 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"

Go to the source code of this file.

Data Structures

struct  dac24_t
 DAC 24 Click context object. More...
struct  dac24_cfg_t
 DAC 24 Click configuration object. More...

Macros

#define DAC24_REG_POWER_DOWN_100K   0x00
 DAC 24 channel register.
#define DAC24_REG_AO1_DATA_OUT   0x01
#define DAC24_REG_AO2_DATA_OUT   0x02
#define DAC24_REG_AO3_DATA_OUT   0x03
#define DAC24_REG_ALL_CH_DATA_OUT   0x07
#define DAC24_REG_POWER_DOWN_2_5K   0x08
#define DAC24_REG_AO1_DATA   0x09
#define DAC24_REG_AO2_DATA   0x0A
#define DAC24_REG_AO3_DATA   0x0B
#define DAC24_REG_POWER_DOWN_HIZ   0x0F
#define DAC24_CHANNEL_ALL   0
 DAC 24 output channel selection.
#define DAC24_CHANNEL_1   1
#define DAC24_CHANNEL_2   2
#define DAC24_CHANNEL_3   3
#define DAC24_POWER_DOWN_HIZ   0
 DAC 24 power settings.
#define DAC24_POWER_DOWN_2_5K   1
#define DAC24_POWER_DOWN_100K   2
#define DAC24_DAC_VALUE_MIN   0x00
 DAC 24 range values.
#define DAC24_DAC_VALUE_MID   0x80
#define DAC24_DAC_VALUE_MAX   0xFF
#define DAC24_VCC_3V3   3300
 DAC 24 VREF and VCC values.
#define DAC24_VCC_5V   5000
#define DAC24_VCC_LEVEL   DAC24_VCC_3V3
#define DAC24_SET_DATA_SAMPLE_EDGE   SET_SPI_DATA_SAMPLE_EDGE
 Data sample selection.
#define DAC24_SET_DATA_SAMPLE_MIDDLE   SET_SPI_DATA_SAMPLE_MIDDLE
#define DAC24_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.

Enumerations

enum  dac24_return_value_t { DAC24_OK = 0 , DAC24_ERROR = -1 }
 DAC 24 Click return value data. More...

Functions

void dac24_cfg_setup (dac24_cfg_t *cfg)
 DAC 24 configuration object setup function.
err_t dac24_init (dac24_t *ctx, dac24_cfg_t *cfg)
 DAC 24 initialization function.
err_t dac24_write_reg (dac24_t *ctx, uint8_t reg, uint8_t data_in)
 DAC 24 write register function.
err_t dac24_set_power_down (dac24_t *ctx, uint8_t pwr)
 DAC 24 set power down function.
err_t dac24_set_dac_value (dac24_t *ctx, uint8_t channel, uint8_t value)
 DAC 24 set DAC value function.
err_t dac24_set_dac_voltage (dac24_t *ctx, uint8_t channel, uint16_t voltage_mv)
 DAC 24 set DAC voltage function.

Detailed Description

This file contains API for DAC 24 Click Driver.

Enumeration Type Documentation

◆ dac24_return_value_t

DAC 24 Click return value data.

Predefined enum values for driver return values.

Enumerator
DAC24_OK 
DAC24_ERROR